home *** CD-ROM | disk | FTP | other *** search
- // mainfrm.cpp : implementation of the CMainFrame class
- //
-
- #include "stdafx.h"
-
- extern "C"
- {
- #include "LLI.H"
- }
-
- #include "LLID.h"
-
- #include "mainfrm.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
-
- IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
-
-
- BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // arrays of IDs used to initialize control bars
-
- static UINT BASED_CODE buttons[] =
- {
- // same order as in the bitmap 'toolbar.bmp'
- ID_FILE_NEW,
- ID_FILE_OPEN,
- ID_FILE_SAVE_AS,
- ID_FILE_PRINT,
- ID_SEPARATOR,
- ID_FIT_HOR,
- ID_FIT_VER,
- ID_FIT_WIN,
- ID_UNFIT_WIN,
- ID_SEPARATOR,
- ID_ROT_R90,
- ID_ROT_L90,
- ID_ROT_180,
- ID_SEPARATOR,
- ID_CROP,
- ID_SEPARATOR,
- ID_ZOOM_IN,
- ID_ZOOM_OUT,
- ID_SEPARATOR,
- ID_TOGGLE_PALETTE,
- ID_SEPARATOR,
- ID_GEN_MOSAIC,
- ID_SEPARATOR,
- ID_IMAGE_INFO,
- ID_SEPARATOR,
- ID_APP_ABOUT,
- };
-
-
- static UINT BASED_CODE indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
-
-
- LLOBJECT lloApp;
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
-
- CMainFrame::CMainFrame()
- {
- // TODO: add member initialization code here
-
- // create a new LightLibraryImage (LLI) - object
- lloApp = oNew( LLO_CLASS_APPLICATION,
- 0,
- -1,
- (DWORD)(0),
- (DWORD)(LPSTR)"LLID, IMAGE-TEST-APPLICATION" );
- OutputDebugString( "\n\rConstructor Mainframe... ");
- oAssign( lloApp, LLO_APPLICATION_CARGO_COUNT_DEFAULT, 10, 0 );
-
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- CMainFrame::~CMainFrame()
- {
- // delete LightLibraryImage (LLI) - object
- OutputDebugString( "\n\rDestructor Mainframe... ");
- lloApp = oDel( lloApp );
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
-
- if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if (!m_wndToolBar.Create(this) ||
- !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
- !m_wndToolBar.SetButtons(buttons,sizeof(buttons)/sizeof(UINT)))
- {
- TRACE("Failed to create toolbar\n");
- return -1; // fail to create
- }
-
- // Statusbar
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- TRACE("Failed to create status bar\n");
- return -1; // fail to create
- }
-
- return 0;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
-
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- GetActiveWindow();
- CMDIFrameWnd::AssertValid();
- }
-
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CMDIFrameWnd::Dump(dc);
- }
-
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
-
-
-
-